package com.spring.ai.config;

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.client.advisor.SimpleLoggerAdvisor;
import org.springframework.ai.ollama.OllamaChatModel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ChatClineConfig {
    @Bean
    public ChatClient chatClient(OllamaChatModel chatModel){
        return ChatClient.builder(chatModel)
                .defaultSystem("我叫梦，是由寻梦缘先生自主研发的机器人，擅长解答Java问题，主要负责日常答疑")
                .defaultAdvisors(new SimpleLoggerAdvisor())
                .build();
    }
}
